package cn.yuanqiao.archive.detection.service.impl;

import cn.yuanqiao.archive.detection.domain.DetectionItem;
import cn.yuanqiao.archive.detection.mapper.DetectionItemMapper;
import cn.yuanqiao.archive.detection.service.IDetectionItemService;
import cn.yuanqiao.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 配置项Service业务层处理
 * 
 * @author xy
 * @date 2023-08-08
 */
@Service
public class DetectionItemServiceImpl implements IDetectionItemService 
{
    @Autowired
    private DetectionItemMapper detectionItemMapper;

    /**
     * 查询配置项
     * 
     * @param id 配置项主键
     * @return 配置项
     */
    @Override
    public DetectionItem selectDetectionItemById(Long id)
    {
        return detectionItemMapper.selectDetectionItemById(id);
    }

    /**
     * 查询配置项列表
     * 
     * @param detectionItem 配置项
     * @return 配置项
     */
    @Override
    public List<DetectionItem> selectDetectionItemList(DetectionItem detectionItem)
    {
        return detectionItemMapper.selectDetectionItemList(detectionItem);
    }

    /**
     * 新增配置项
     * 
     * @param detectionItem 配置项
     * @return 结果
     */
    @Override
    public int insertDetectionItem(DetectionItem detectionItem)
    {
        detectionItem.setCreateTime(DateUtils.getNowDate());
        return detectionItemMapper.insertDetectionItem(detectionItem);
    }

    /**
     * 修改配置项
     * 
     * @param detectionItem 配置项
     * @return 结果
     */
    @Override
    public int updateDetectionItem(DetectionItem detectionItem)
    {
        return detectionItemMapper.updateDetectionItem(detectionItem);
    }

    /**
     * 批量删除配置项
     * 
     * @param ids 需要删除的配置项主键
     * @return 结果
     */
    @Override
    public int deleteDetectionItemByIds(Long[] ids)
    {
        return detectionItemMapper.deleteDetectionItemByIds(ids);
    }

    /**
     * 删除配置项信息
     * 
     * @param id 配置项主键
     * @return 结果
     */
    @Override
    public int deleteDetectionItemById(Long id)
    {
        return detectionItemMapper.deleteDetectionItemById(id);
    }
}
